.class final Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;
.super Ljava/lang/Object;
.source "LinkedTransferQueue.java"

# interfaces
.implements Ljava/util/Iterator;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lorg/jboss/netty/util/internal/LinkedTransferQueue;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x10
    name = "Itr"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Ljava/util/Iterator",
        "<TE;>;"
    }
.end annotation


# instance fields
.field private lastPred:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

.field private lastRet:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

.field private nextItem:Ljava/lang/Object;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "TE;"
        }
    .end annotation
.end field

.field private nextNode:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

.field final synthetic this$0:Lorg/jboss/netty/util/internal/LinkedTransferQueue;


# direct methods
.method constructor <init>(Lorg/jboss/netty/util/internal/LinkedTransferQueue;)V
    .locals 1
    .parameter

    .prologue
    .line 893
    .local p0, this:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;,"Lorg/jboss/netty/util/internal/LinkedTransferQueue<TE;>.Itr;"
    iput-object p1, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->this$0:Lorg/jboss/netty/util/internal/LinkedTransferQueue;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 894
    const/4 v0, 0x0

    invoke-direct {p0, v0}, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->advance(Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;)V

    .line 895
    return-void
.end method

.method private advance(Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;)V
    .locals 8
    .parameter "prev"

    .prologue
    .local p0, this:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;,"Lorg/jboss/netty/util/internal/LinkedTransferQueue<TE;>.Itr;"
    const/4 v7, 0x0

    .line 847
    iget-object v4, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->lastRet:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .local v4, r:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    if-eqz v4, :cond_2

    invoke-virtual {v4}, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->isMatched()Z

    move-result v6

    if-nez v6, :cond_2

    .line 848
    iput-object v4, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->lastPred:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .line 859
    :cond_0
    :goto_0
    iput-object p1, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->lastRet:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .line 861
    move-object v3, p1

    .line 862
    .local v3, p:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    :goto_1
    if-nez v3, :cond_5

    iget-object v6, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->this$0:Lorg/jboss/netty/util/internal/LinkedTransferQueue;

    iget-object v5, v6, Lorg/jboss/netty/util/internal/LinkedTransferQueue;->head:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .line 863
    .local v5, s:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    :goto_2
    if-nez v5, :cond_6

    .line 889
    :cond_1
    iput-object v7, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->nextNode:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .line 890
    iput-object v7, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->nextItem:Ljava/lang/Object;

    .line 891
    :goto_3
    return-void

    .line 849
    .end local v3           #p:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    .end local v5           #s:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    :cond_2
    iget-object v0, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->lastPred:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .local v0, b:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    if-eqz v0, :cond_3

    invoke-virtual {v0}, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->isMatched()Z

    move-result v6

    if-eqz v6, :cond_4

    .line 850
    :cond_3
    iput-object v7, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->lastPred:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    goto :goto_0

    .line 855
    :cond_4
    :goto_4
    iget-object v5, v0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->next:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .restart local v5       #s:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    if-eqz v5, :cond_0

    if-eq v5, v0, :cond_0

    invoke-virtual {v5}, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->isMatched()Z

    move-result v6

    if-eqz v6, :cond_0

    iget-object v2, v5, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->next:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .local v2, n:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    if-eqz v2, :cond_0

    if-eq v2, v5, :cond_0

    .line 856
    invoke-virtual {v0, v5, v2}, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->casNext(Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;)Z

    goto :goto_4

    .line 862
    .end local v0           #b:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    .end local v2           #n:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    .end local v5           #s:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    .restart local v3       #p:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    :cond_5
    iget-object v5, v3, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->next:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    goto :goto_2

    .line 865
    .restart local v5       #s:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    :cond_6
    if-ne v5, v3, :cond_7

    .line 866
    const/4 v3, 0x0

    .line 867
    goto :goto_1

    .line 869
    :cond_7
    iget-object v1, v5, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->item:Ljava/lang/Object;

    .line 870
    .local v1, item:Ljava/lang/Object;
    iget-boolean v6, v5, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->isData:Z

    if-eqz v6, :cond_8

    .line 871
    if-eqz v1, :cond_9

    if-eq v1, v5, :cond_9

    .line 872
    invoke-static {v1}, Lorg/jboss/netty/util/internal/LinkedTransferQueue;->cast(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v6

    iput-object v6, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->nextItem:Ljava/lang/Object;

    .line 873
    iput-object v5, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->nextNode:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    goto :goto_3

    .line 877
    :cond_8
    if-eqz v1, :cond_1

    .line 880
    :cond_9
    if-nez v3, :cond_a

    .line 881
    move-object v3, v5

    goto :goto_1

    .line 882
    :cond_a
    iget-object v2, v5, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->next:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .restart local v2       #n:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    if-eqz v2, :cond_1

    .line 884
    if-ne v5, v2, :cond_b

    .line 885
    const/4 v3, 0x0

    goto :goto_1

    .line 887
    :cond_b
    invoke-virtual {v3, v5, v2}, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->casNext(Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;)Z

    goto :goto_1
.end method


# virtual methods
.method public final hasNext()Z
    .locals 1

    .prologue
    .line 898
    .local p0, this:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;,"Lorg/jboss/netty/util/internal/LinkedTransferQueue<TE;>.Itr;"
    iget-object v0, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->nextNode:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    if-eqz v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public final next()Ljava/lang/Object;
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TE;"
        }
    .end annotation

    .prologue
    .line 902
    .local p0, this:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;,"Lorg/jboss/netty/util/internal/LinkedTransferQueue<TE;>.Itr;"
    iget-object v1, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->nextNode:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .line 903
    .local v1, p:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    if-nez v1, :cond_0

    new-instance v2, Ljava/util/NoSuchElementException;

    invoke-direct {v2}, Ljava/util/NoSuchElementException;-><init>()V

    throw v2

    .line 904
    :cond_0
    iget-object v0, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->nextItem:Ljava/lang/Object;

    .line 905
    .local v0, e:Ljava/lang/Object;,"TE;"
    invoke-direct {p0, v1}, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->advance(Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;)V

    .line 906
    return-object v0
.end method

.method public final remove()V
    .locals 3

    .prologue
    .line 910
    .local p0, this:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;,"Lorg/jboss/netty/util/internal/LinkedTransferQueue<TE;>.Itr;"
    iget-object v0, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->lastRet:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .line 911
    .local v0, lastRet:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;
    if-nez v0, :cond_0

    .line 912
    new-instance v1, Ljava/lang/IllegalStateException;

    invoke-direct {v1}, Ljava/lang/IllegalStateException;-><init>()V

    throw v1

    .line 913
    :cond_0
    const/4 v1, 0x0

    iput-object v1, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->lastRet:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    .line 914
    invoke-virtual {v0}, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;->tryMatchData()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 915
    iget-object v1, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->this$0:Lorg/jboss/netty/util/internal/LinkedTransferQueue;

    iget-object v2, p0, Lorg/jboss/netty/util/internal/LinkedTransferQueue$Itr;->lastPred:Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;

    invoke-virtual {v1, v2, v0}, Lorg/jboss/netty/util/internal/LinkedTransferQueue;->unsplice(Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;Lorg/jboss/netty/util/internal/LinkedTransferQueue$Node;)V

    .line 916
    :cond_1
    return-void
.end method
